package com.rising.face.proxy.jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MybatisInvocationHandler implements InvocationHandler {
    private OnLineShopping onLineShopping;

    public MybatisInvocationHandler(OnLineShopping onLineShopping) {
        this.onLineShopping = onLineShopping;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        //将sell接口中sellOnLine的方法，转换为onLineShopping中sellOnLine方法的调用
        return onLineShopping.sellOnLine();
    }

}
